package com.wuzihao.disk.Recycle.repository;

import com.wuzihao.disk.mybatis.flexigrid.PagingEntity;
import com.wuzihao.disk.Recycle.entity.FileEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FileRepository {

    List<FileEntity> queryRecycleFilesByUser(
            @Param("userId") String userId,
            @Param("searchEntity") FileEntity searchEntity,
            @Param("paging") PagingEntity paging);

    int countRecycleFiles(
            @Param("userId") String userId,
            @Param("searchEntity") FileEntity searchEntity);

    // 保持向后兼容的方法
    List<FileEntity> queryRecycleFilesByUser(
            @Param("userId") String userId,
            @Param("paging") PagingEntity paging);

    int countRecycleFiles(@Param("userId") String userId);

    void restoreFile(@Param("fileId") String fileId, @Param("userId") String userId);

    void deletePermanently(@Param("fileId") String fileId, @Param("userId") String userId);

    void moveToRecycle(@Param("fileId") String fileId, @Param("userId") String userId);

    int insertToTrash(@Param("fileId") String fileId, @Param("userId") String userId);

    int deleteFromFile(@Param("fileId") String fileId, @Param("userId") String userId);

    int insertToFile(@Param("fileId") String fileId, @Param("userId") String userId);

    int deleteFromTrash(@Param("fileId") String fileId, @Param("userId") String userId);
}
